package com.design.adnroid.campussecondarytrading.activity;

import android.app.ActivityGroup;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;

public class MainActivity extends ActivityGroup {

    private TabHost tabHost;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        tabHost = (TabHost) findViewById(R.id.main_tabHost);

        tabHost.setup(getLocalActivityManager());

        Intent intent1 = new Intent(this,HomePageActivity.class);
        Intent intent2 = new Intent(this,AddGoodsActivity.class);
        Intent intent3 = new Intent(this,PersonalActivity.class);
//
        tabHost.addTab(tabHost.newTabSpec("")
                .setIndicator(getString(R.string.title_activity_homePage),null)
                .setContent(intent1));
        tabHost.addTab(tabHost.newTabSpec("")
                .setIndicator(getString(R.string.title_activity_addGoods),null)
                .setContent(intent2));
        tabHost.addTab(tabHost.newTabSpec("")
                .setIndicator(getString(R.string.title_activity_personal),null)
                .setContent(intent3));
    }

}
